package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:04:50
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SystemRoleGroup implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id", com.ourteam.system.dao.ISysRoleGroupDAO.Id);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysRoleGroupDAO.Remarks);

        mappedDaoFields.put("code",
            com.ourteam.system.dao.ISysRoleGroupDAO.RoleCode);

        mappedDaoFields.put("name",
            com.ourteam.system.dao.ISysRoleGroupDAO.RoleName);

        mappedDaoFields.put("type",
            com.ourteam.system.dao.ISysRoleGroupDAO.RoleType);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysRoleGroupDAO.Status);

        mappedDaoFields.put("defaultFlag",
            com.ourteam.system.dao.ISysRoleGroupDAO.DefaultFlag);

        mappedDaoFields.put("modifyTime",
            com.ourteam.system.dao.ISysRoleGroupDAO.ModifyTime);

        mappedDaoFields.put("operatorId",
            com.ourteam.system.dao.ISysRoleGroupDAO.OperatorId);

        mappedDaoFields.put("operatorName",
            com.ourteam.system.dao.ISysRoleGroupDAO.OperatorName);
    }

    private com.ourteam.system.dao.SysRoleGroup sysRoleGroup;

    public SystemRoleGroup() {
        super();

        this.sysRoleGroup = new com.ourteam.system.dao.SysRoleGroup();
    }

    public SystemRoleGroup(com.ourteam.system.dao.SysRoleGroup sysRoleGroup) {
        super();

        this.sysRoleGroup = sysRoleGroup;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysRoleGroup);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysRoleGroup convertToSysRoleGroup() {
        return this.sysRoleGroup;
    }

    public com.ourteam.system.dao.SysRoleGroup convertTo() {
        return this.sysRoleGroup;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysRoleGroup.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysRoleGroup.setId(id);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysRoleGroup.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysRoleGroup.setRemarks(remarks);
    }

    /**
     * Get code
     *
     * @return String
     */
    public String getCode() {
        return (String) this.sysRoleGroup.getRoleCode();
    }

    /**
     * Set code
     *
     * @parameter String
     */
    public void setCode(String code) {
        this.sysRoleGroup.setRoleCode(code);
    }

    /**
     * Get name
     *
     * @return String
     */
    public String getName() {
        return (String) this.sysRoleGroup.getRoleName();
    }

    /**
     * Set name
     *
     * @parameter String
     */
    public void setName(String name) {
        this.sysRoleGroup.setRoleName(name);
    }

    /**
     * Get type
     *
     * @return String
     */
    public String getType() {
        return (String) this.sysRoleGroup.getRoleType();
    }

    /**
     * Set type
     *
     * @parameter String
     */
    public void setType(String type) {
        this.sysRoleGroup.setRoleType(type);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysRoleGroup.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysRoleGroup.setStatus(status);
    }

    /**
     * Get defaultFlag
     *
     * @return String
     */
    public String getDefaultFlag() {
        return (String) this.sysRoleGroup.getDefaultFlag();
    }

    /**
     * Set defaultFlag
     *
     * @parameter String
     */
    public void setDefaultFlag(String defaultFlag) {
        this.sysRoleGroup.setDefaultFlag(defaultFlag);
    }

    /**
     * Get modifyTime
     *
     * @return java.util.Date
     */
    public java.util.Date getModifyTime() {
        return (java.util.Date) this.sysRoleGroup.getModifyTime();
    }

    /**
     * Set modifyTime
     *
     * @parameter java.util.Date
     */
    public void setModifyTime(java.util.Date modifyTime) {
        this.sysRoleGroup.setModifyTime(modifyTime);
    }

    /**
     * Get operatorId
     *
     * @return long
     */
    public long getOperatorId() {
        return (long) this.sysRoleGroup.getOperatorId();
    }

    /**
     * Set operatorId
     *
     * @parameter long
     */
    public void setOperatorId(long operatorId) {
        this.sysRoleGroup.setOperatorId(operatorId);
    }

    /**
     * Get operatorName
     *
     * @return String
     */
    public String getOperatorName() {
        return (String) this.sysRoleGroup.getOperatorName();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SystemRoleGroup) == false) {
            return false;
        } // end if

        SystemRoleGroup other = (SystemRoleGroup) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysRoleGroup tempSysRoleGroup = other.convertToSysRoleGroup();

        if ((tempSysRoleGroup == null) || (this.sysRoleGroup == null)) {
            isEqual = false;
        } else if ((tempSysRoleGroup == this.sysRoleGroup) ||
                tempSysRoleGroup.equals(this.sysRoleGroup)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SystemRoleGroup[] toArray(
        com.ourteam.system.dao.SysRoleGroup[] aSysRoleGroups) {
        return toArray(aSysRoleGroups, null);
    }

    public static SystemRoleGroup[] toArray(
        com.ourteam.system.dao.SysRoleGroup[] aSysRoleGroups,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysRoleGroups)) {
            return new SystemRoleGroup[0];
        }

        int length = aSysRoleGroups.length;

        SystemRoleGroup[] beans = new SystemRoleGroup[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SystemRoleGroup(aSysRoleGroups[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i], new Object[] { aSysRoleGroups[i] });
            }
        }

        return beans;
    }
}
